<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form" >
        <el-descriptions title="设备信息" style="text-align: center" :column="4" border >
          <el-descriptions-item :contentStyle="contentStyle" label="设备类别"  label-class-name="my-label" :labelStyle="labelStyle" >
            <!--<span v-if="form.equipmentType==1">成分分析</span>
            <span v-if="form.equipmentType==2">微区分析</span>
            <span v-if="form.equipmentType==3">感官分析</span>
            <span v-if="form.equipmentType==4">物性分析</span>
            <span v-if="form.equipmentType==5">分子生物学分析</span>
            <span v-if="form.equipmentType==6">微生物分析</span>
            <span v-if="form.equipmentType==7">常规分析</span>
            <span v-if="form.equipmentType==8">前处理仪器设备</span>
            <span v-if="form.equipmentType==9">离心分离分析</span>
            <span v-if="form.equipmentType==10">分析软件</span>
            <span v-if="form.equipmentType==11">其他</span>
            <span v-if="form.equipmentType==12">会议室</span>-->
            <dict-tag :options="dict.type.yh_equip_type" :value="form.equipmentType"/>
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="设备名称"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.instrumentName}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="设备编号"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.instrumentId}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="领用单位"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.applicationDepartment}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="型号"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.modelNumber}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="规格"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.specification}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="单价"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.unitPrice}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="分类号"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.classifyNumber}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="购置日期"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.purchaseDate}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="领用人工号"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.receiverId}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="领用人姓名"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.receiverName}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="厂家"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.manufacturers}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="入库日期"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.storageDate}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="存放地名称"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.storageLocation}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="经费科目"  label-class-name="my-label" :labelStyle="labelStyle" >
            <!--{{form.expenditureSubject}}-->
            <span v-if="form.expenditureSubject==0">科研</span>
            <span v-if="form.expenditureSubject==1">教学</span>
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="使用方向"  label-class-name="my-label" :labelStyle="labelStyle" >
            <!--{{form.useDirection}}-->
            <span v-if="form.useDirection==0">科研</span>
            <span v-if="form.useDirection==1">教学</span>
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="提交时间"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.sbumitTime}}</el-descriptions-item>
          <!--          <el-descriptions-item :contentStyle="contentStyle" label="资料附件" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >
                      <el-button @click="hadledownload">下载</el-button></el-descriptions-item>-->
        </el-descriptions>
        <br/>
        <el-descriptions title="预约信息" style="text-align: center" :column="4" border >
          <el-descriptions-item :contentStyle="contentStyle"label="学号"   label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.studentId}}</el-descriptions-item>
<!--          <el-descriptions-item :contentStyle="contentStyle" label="部门" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.department}}</el-descriptions-item>-->
          <el-descriptions-item :contentStyle="contentStyle" label="姓名"   label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.name}}</el-descriptions-item>
<!--          <el-descriptions-item :contentStyle="contentStyle"label="电话" :span="2"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.phone}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="身份证号" :span="2"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.idCard}}</el-descriptions-item>-->
<!--          <el-descriptions-item :contentStyle="contentStyle" label="协助人姓名"   label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.assistName}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="协助人工号"   label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.assistId}}</el-descriptions-item>-->
          <el-descriptions-item :contentStyle="contentStyle" label="首次使用"  label-class-name="my-label" :labelStyle="labelStyle" >
            <!--{{form.firstUse}}-->
            <span v-if="form.firstUse==0">是</span>
            <span v-if="form.firstUse==1">否</span>
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="设备状态"  label-class-name="my-label" :labelStyle="labelStyle" >
            <!--{{form.firstUse}}-->
            <span v-if="form.note3==0" class="statu">正常使用</span>
            <span v-if="form.note3==1" class="statu1">已作废</span>
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="开始使用时间"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.appointmentStart}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="结束使用时间"  label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.appointmentEnd}}</el-descriptions-item>
        </el-descriptions>
        <br/>

        <el-descriptions  title="审核信息" style="text-align: center" :column="4" border >
          <!--          <el-descriptions-item :contentStyle="contentStyle" label="创建日期" :span="1" label-class-name="my-label" :labelStyle="labelStyle" >{{ form.daydate}}</el-descriptions-item>-->

<!--          <el-descriptions-item :contentStyle="contentStyle" label="教师审核结果" :span="2" label-class-name="my-label" :labelStyle="labelStyle" >&lt;!&ndash;{{ form.auditStatus }}&ndash;&gt;
            <span v-if="form.teacherResult==0">待审核</span>
            <span v-if="form.teacherResult==1">审核通过</span>
            <span v-if="form.teacherResult==2">审核未通过</span>
          </el-descriptions-item>-->
          <el-descriptions-item :contentStyle="contentStyle" label="审核状态"  :span="4" label-class-name="my-label" :labelStyle="labelStyle" ><!--{{ form.auditStatus }}-->
<!--            <template slot-scope="scope">-->
              <span v-if="form.auditStatus==0&&form.note1==0">待审核</span>
              <span v-if="form.auditStatus==1&&form.note1==0">审核通过</span>
              <span v-if="form.auditStatus==2&&form.note1==0">审核未通过</span>
              <span v-if="form.note1==1">预约取消</span>
<!--            </template>-->
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="领用人审核结果" :span="2" label-class-name="my-label" :labelStyle="labelStyle" ><!--{{ form.auditStatus }}-->
            <span v-if="form.adminResult==0">待审核</span>
            <span v-if="form.adminResult==1">审核通过</span>
            <span v-if="form.adminResult==2">审核未通过</span>
          </el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="协助人审核结果" :span="2" label-class-name="my-label" :labelStyle="labelStyle" ><!--{{ form.auditStatus }}-->
            <span v-if="form.assistResult==0">待审核</span>
            <span v-if="form.assistResult==1">审核通过</span>
            <span v-if="form.assistResult==2">审核未通过</span>
          </el-descriptions-item>

          <el-descriptions-item :contentStyle="contentStyle" label="领用人审核时间"  :span="2" label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.adminTime}}</el-descriptions-item>
          <el-descriptions-item :contentStyle="contentStyle" label="协助人审核时间"  :span="2" label-class-name="my-label" :labelStyle="labelStyle" >
            {{form.assistTime}}</el-descriptions-item>
        </el-descriptions>
      </el-form>
      <br/>
      <div style="float:right; margin-bottom: 15px;">
        <el-button @click="viewCancel">返 回</el-button>
<!--        console.log()-->
      </div>
    </el-card>
  </div>
</template>
<style scoped>
.el-header, .el-footer {
  background-color: #FFFFFF;
  color: #333;
  text-align: left;
  line-height: 60px;
  font-style: oblique;

}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #FFFFFF;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

/*对话框标题样式*/
.el-dialog__title{
  /*color: #1ab394;*/
  font-weight: bold;
  font-size: 25px;
}
</style>

<script>
import {listAppointment, getAppointment, delAppointment, addAppointment, updateAppointment} from "@/api/module/lck/appointment";
import { getToken } from "@/utils/auth";
import { importTemplate } from "@/api/system/user";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  dicts:['yh_equip_type'],
  name: "Appointment",
  data() {
    return {
      contentStyle:{
        'width':'200px'
      },
      form:{},
      labelStyle: { 'width': '12%','color': '#000000','text-align': 'right', },
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: false,
      // 总条数
      total: 0,
      // 部门树选项
      deptOptions: undefined,
      // 合同资料表格数据
      fileList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
    };
  },

  created() {
    const id = this.$route.query.id;
    if (id) {
      // 获取表详细信息

      getAppointment(id).then(res => {

        this.form = res.data;
      });

    }
  },
  methods: {


    /** 关闭按钮 */
    viewCancel() {
      const id = this.$route.query.id;
      getAppointment(id).then(response => {
        this.form = response.data;
      });
      const obj = { path: "/lckappointment", query: {id} };
      this.$tab.closeOpenPage(obj);
    },


    hadledownload(){

      const resource = this.form.enclosure;
      console.log( this.form.enclosure+"path");
// 默认方法
      this.$download.resource(resource);
    }
  },

};
</script>
<style>
.statu{
color: #00afff;
}
.statu1{
  color: red;
}
</style>








